// 'use strict';
import * as vscode from 'vscode';

const { Position, Range, DocumentHighlight } = vscode;

export function activate(context: vscode.ExtensionContext) {
  let aa = vscode.languages.registerHoverProvider({ scheme: '*', language: '*' }, {
    provideHover(document, position, token) {
      let startCharacter = position.character;
      let afterCharacter = position.character;

      while (document.getText(new Range(
        new Position(position.line, startCharacter), new Position(position.line, startCharacter - 1))) !== '\'') {
        startCharacter -= 1;
      }

      while (document.getText(new Range(
        new Position(position.line, afterCharacter), new Position(position.line, afterCharacter + 1))) !== '\'') {
        afterCharacter += 1;
      }
      const string = document.getText(new Range(
        new Position(position.line, startCharacter), new Position(position.line, afterCharacter)));

      vscode.env.clipboard.writeText(string);
      if (false) {
        return new vscode.Hover('');
      }
    },
  });

  context.subscriptions.push(aa);


}

export function deactivate() {
}
